package org.sundy.webservice.cxf.demo;

import java.net.URL;

import com.skyarm.yuex.jk.comp.CompanyDelegate;
import com.skyarm.yuex.jk.comp.CompanyService;
import com.skyarm.yuex.jk.comp.DiscountType;

public class Demo {

	public static void main(String[] args) throws Exception {
		/*
		 * CXFFactory factory = new CXFFactory(); factory.setWsdlURL(
		 * "http://yx100service.televehicle.com:8081/ct-service/services/CompanyService?wsdl"
		 * ); factory.setServiceClass(CompanyService.class);
		 * factory.setDelegateMethod("getCompanyPort");
		 * 
		 * CompanyDelegate cd = (CompanyDelegate) factory.createDelegate();
		 * System.out.println(cd.getComDiscountInfo());
		 */

		URL url = new URL(
				"http://yx100service.televehicle.com:8081/ct-service/services/CompanyService?wsdl");
		CompanyService cs = new CompanyService(url);
		CompanyDelegate companyDelegete = cs.getCompanyPort();
		// System.out.println(companyDelegete);
		for (DiscountType discountInfo : companyDelegete.getComDiscountInfo()) {
			System.out.print(discountInfo.getTypeId());
			System.out.print("\t" + discountInfo.getTypeName());
			System.out.print("\t" + discountInfo.getTypeCount());
			System.out.println();
		}
	}
}
